<!--
 * @Description: 
 * @Author: 胡涛
 * @Date: 2023-06-06 09:04:03
 * @LastEditors: 胡涛
 * @LastEditTime: 2023-12-18 22:46:51
-->
<script setup lang="ts">
import zhCN from "ant-design-vue/es/locale/zh_CN";
import { onMounted } from "vue";
import { useLoadingCheck, checkloadingToken } from "./helpers/loading";
import { useInterceptors } from "@/api";
import { getApplicationConfig } from "@/helpers/config";

const configProps = {
  locale: zhCN,
  componentSize: "middle",
  theme: {
    token: {
      colorPrimary: "#3c8dbc",
      // colorPrimary: "#00BF83",
    },
  },
};

onMounted(() => {
  document.title = getApplicationConfig().title;
  //处理有桌面缩放时的问题
  if (window.devicePixelRatio *window.screen.width<=1920 && window.devicePixelRatio>1) {
    (document.body.style as any).zoom = 1.0 / window.devicePixelRatio;
  }
  useInterceptors();
  checkloadingToken();
  useLoadingCheck();
});
</script>

<template>
  <div id="app">
    <a-config-provider v-bind="configProps">
      <router-view />
    </a-config-provider>
  </div>
</template>
